1. Field of the Invention
The present invention relates to an image processor for a robot system. The present invention also relates to a robot system including an image processor.
2. Description of the Related Art
An area image sensor, such as a CCD camera, (hereinafter referred to as a “camera”) typically scans an image formed on an imaging device, in which pixels are arranged in a matrix, horizontally from the top left of the image and sequentially outputs electric signals of the pixels of a single scan line. When the camera scans throughout the line to the right end of the image, it returns to the head of a subsequent line to scan the subsequent line and output the electric signals thereof. The camera repeatedly performs the operation described above, and thereby scans entirely a single image and output a video signal of the single image. Two scan modes are known: one being a progressive mode in which a camera scans lines in sequence from top down and outputs the video signal of an entire image; and the other being an interlace mode in which a camera scans every other line and outputs the video signal of odd-numbered lines (i.e., a first field) and the video signal of even-numbered lines (i.e., a second field), so as to output the total video signal of an entire image.
The video signal of a dynamic image includes a plurality of successive frames, wherein a frame represents image data of a single entire image including image data of a plurality of lines. Consequently, in order for an image processor to process the video signal of the dynamic image, it is necessary that the image processor recognizes the starting position of each frame (or field) and the starting position of each line, in the video signal input from a camera to the image processor, so as to synchronize the timing of the beginning of the video signal and the timing of the beginning of the image processing. For this purpose, the video signal includes a vertical synchronization signal indicating the starting position of each frame (or field) and a horizontal synchronization signal indicating the starting position of each line, in addition to the image data. The vertical synchronization signal and the horizontal synchronization signal may be provided as an internal synchronization signal generated in the camera, or alternatively, as an external synchronization signal generated by the image processor at a frequency identical to a frequency of the internal synchronization signal. In an internal synchronization mode using the internal synchronization signal, the image processor separates the internal synchronization signal from the video signal output from the camera and uses the internal synchronization signal, so as to synchronize the image processing. In an external synchronization mode using the external synchronization signal, the image processor supplies the generated external synchronization signal to the camera and allows the camera to output the video signal synchronized with the external synchronization signal, so as to synchronize the image processing. In the camera adopting the external synchronization mode, when the external synchronization signal is not provided, the camera may automatically output the video signal synchronized with the internal synchronization signal.
A camera may have individual difference, such as a slight difference in characteristics of an imaging device, the attachment position of a lens, and the like. Consequently, when the camera connected to an image processor is replaced with another camera, it may be necessary for the image processor to adjust the settings of a white balance, a focus, an exposure, and the like. Japanese Unexamined Patent Publication (Kokai) No. 11-215412 (JP-A-11-215412) describes a video image input device that automatically adjusts the settings so as to absorb the individual difference of a camera when the camera is replaced with another camera.
Further, the internal synchronization signals of cameras are generated independently of each other. Consequently, when a plurality of different cameras generating internal synchronization signals at the same time are connected to a single image processor, it may be necessary for the image processor to control the timing of the internal synchronization signals. Japanese Unexamined Patent Publication (Kokai) No. 9-224192 (JP-A-9-224192) describes a picture synthesizer, in which, when a plurality of different cameras generating internal synchronization signals at the same time are connected to a single image processor and images captured by the cameras are simultaneously displayed on a monitor, the image processor provides external synchronization signals to the respective cameras so as to allow the cameras to output the video signals at appropriate timing.
In a robot system that uses an image processor for correcting an operation of a robot based on image data obtained from a camera, if a robot controller cannot recognize which timing the image data obtained from the camera is captured, the robot controller cannot appropriately correct the operation of the robot. For example, in the case where the robot operates to hold an object conveyed on a conveyor, if the robot controller does not accurately recognize which timing the image data obtained from the camera is captured, the robot controller may incorrectly estimate a time when the object reaches a predetermined position and thus may make it difficult for the robot to hold the object. In order to avoid this problem, the robot system is configured in such a manner that the image processor provides the camera with the external synchronization signal generated at the same period as the internal synchronization signal of the camera and allows the camera to output the image data synchronized with the external synchronization signal, so that the operation of the robot can be corrected based on a result of the image processing of the image data obtained at desired timing. To this end, it may be necessary to previously set, in the image processor, a synchronization signal frequency suitable for the camera connected to the image processor, and to provide the connected camera with the external synchronization signal suitable for the said camera.
The frequencies of vertical and horizontal synchronization signals, suitable for a camera, are specific to each type of cameras, regardless of whether the synchronization signals are internal or external. If the vertical and horizontal synchronization signals having frequencies different from the specific frequencies are provided as the external synchronization signal to the camera, malfunctions, such as distortion of an image, may occur. Consequently, when the image processor provides the external synchronization signal to the camera, it may be necessary to set the frequency of the external synchronization signal to be identical to the frequency of the internal synchronization signal of the camera connected to the image processor.
Further, when an image processing is performed based on an image output from a camera, the image processing is performed after image data, an amount of which corresponds to the number of pixels of the camera connected to an image processor, is stored in a storage section, such as a RAM, of the image processor. On the other hand, the number of pixels of the camera may vary with the type of the camera. As a result, it may be necessary to previously allocate a data area for image processing to the storage section, such as the RAM, in consideration of the number of pixels of the camera connected to the image processor.
Consequently, in the robot system, when several types of cameras are connected to the image processor simultaneously or alternately, in order to provide the connected camera (or cameras) with external synchronization signal (or signals) having a frequency (or frequencies) suitable for the camera (or cameras), it may be necessary to previously set, in the image processor, the frequency (or frequencies) of the external synchronization signal (or signals) to be identical to the frequency (or frequencies) of the internal synchronization signal (or signals) of the connected camera (or cameras). Further, in order to store the image data, the amount of which corresponds to the number of pixels of the camera (or cameras) in the storage section, such as the RAM, of the image processor, it may be necessary to previously allocate the data area for image processing to the storage section, such as the RAM, in consideration of the number of pixels of the connected camera (or cameras).
However, the aforementioned setting and allocation have conventionally been manually performed by an operator depending on the type of the camera in use, and therefore, errors may occur in the setting and allocation, which may cause malfunctions, such as inability of the image processor to import image data.
Further, the video image input device as set forth in JP-A-11-215412 or the picture synthesizer as set forth in JP-A-9-224192 cannot automatically perform, when a connected camera is replaced with a different type of camera, the setting of the frequency of a synchronization signal depending on the type of the camera and the allocation of a data area for image processing depending on the number of pixels of the camera.